package com.egao.orderB.controller;

import com.egao.common.core.annotation.ApiPageParam;
import com.egao.common.core.damon.results.PageResult2;
import com.egao.common.core.web.*;
import com.egao.common.core.annotation.OperLog;
import com.egao.orderB.entity.PutInfo;
import com.egao.orderB.service.PutInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.ui.Model;


/**
 *
 * 入库单基本信息
 * @author : Doman
 * @date : 2021-12-23 16:56:05
 * @version ：1.0
 */

@Api(tags = "入库单基本信息")
@RestController
@RequestMapping("/api/orderB/putInfo")
public class PutInfoController extends BaseController {

	@Autowired
	private PutInfoService putInfoService;

	/**
	 * 分页查询列表
	 */
	@PreAuthorize("hasAuthority('orderB:putInfo:list')")
  @ApiOperation(value ="分页查询入库单基本信息",notes = "" +
    "limit:每页显示几行 必填\n" +
    "page:第几页 必填\n" +
    " \n\n\n" +
    "返回的结果:\n" +
    "id:id\n" +
    "putInStorageId:入库信息id\n" +
    "insideRemark:内部备注\n" +
    "entrustmentRemark:托书备注\n" +
    "name:业务员id\n" +
    "stockNum:业务员\n" +
    "salesmanId:业务员Id\n" +
    "salesman:业务员\n" +
    "examineId:审核员Id\n" +
    "examine:审核员\n" +
    "customerServiceId:客服id\n" +
    "customerService:客服\n" +
    "overseaCustomerService:海外客服\n" +
    "operaterId:操作Id\n" +
    "operater:操作\n" +
    "fileName:文件\n" +
    "financialAffairs:财务\n" +
    "bookingSpace:订舱/仓管\n" +
    "cabinetNum:派车/柜号\n" +
    "billOfLading:订单号\n" +
    "customerId:客户id\n" +
    "customer:客户\n" +
    "bookingAgent:订舱代理\n" +
    "dispatchAgent:派送代理\n" +
    "customsClearanceAgent:清关代理\n" +
    "productCode:货物品名 / 商品编码\n" +
    "productNum:商品数量\n" +
    "tradeTerms:贸易条款 / 申报货值\n" +
    "reconciliationDate:对账日期\n" +
    "bookingSpaceEtd:订舱ETD\n" +
    "dispatchDate:派送日期\n" +
    "paymentPath:付款方式\n" +
    "termsOfService:服务条款\n" +
    "referenceNumberEdi:参考号(EDI)\n" +
    "ctnMawb:CTN/MAWB#\n" +
    "originatingArea:始发区域\n" +
    "arrivalArea:到达区域\n" +
    "placeOfReceipt:收货地\n" +
    "originSz:始发地 (SZ001)\n" +
    "transitPlace:中转地\n" +
    "destination:目的地\n" +
    "hbl:HBL号\n" +
    "consigneeId:收货人id\n" +
    "consignee:收货人\n" +
    "notifierId:通知人id\n" +
    "notifier:通知人\n" +
    "pickUpAgent:提货代理\n" +
    "shippingMark:唛 头\n" +
    "productDec:货物描述\n" +
    "shippingAddress:送货地址\n" +
    "remark:备注\n" +
    "orderNum:排序\n" +
    "createTime:创建时间\n" +
    "createUser:创建人\n" +
    "updateTime:更新时间\n" +
    "updateUser:更新人\n" +
    "",httpMethod = "POST")
  @ApiPageParam
  @PostMapping("/list")
  public JsonResult page(PageResult2<T> page, PutInfo putInfo) throws Exception{
    return putInfoService.list(page, putInfo, getLoginUser());
  }

  /**
   * 查询全部入库单基本信息
   */
  @PreAuthorize("hasAuthority('orderB:putInfo:list')")
  @ApiOperation("查询全部入库单基本信息")
  @PostMapping("/listAll")
  public JsonResult list(PutInfo putInfo){
    return putInfoService.list(putInfo, getLoginUser());
  }

  /**
   * 根据id查询入库单基本信息
   */
  @PreAuthorize("hasAuthority('orderB:putInfo:list')")
  @ApiOperation("根据id查询入库单基本信息")
  @PostMapping("/get")
  public JsonResult get(PutInfo putInfo) {
    return putInfoService.getById(putInfo);
  }


  /**
   * 添加入库单基本信息
   */
  @PreAuthorize("hasAuthority('orderB:putInfo:save')")
  @OperLog(value = "入库单基本信息", desc = "添加", param = false, result = true)
  @ApiOperation(value ="添加入库单基本信息",notes = "" +
          "putInStorageId:入库信息id\n" +
    "insideRemark:内部备注\n" +
    "entrustmentRemark:托书备注\n" +
    "name:业务员id\n" +
    "stockNum:业务员\n" +
    "salesmanId:业务员Id\n" +
    "salesman:业务员\n" +
    "examineId:审核员Id\n" +
    "examine:审核员\n" +
    "customerServiceId:客服id\n" +
    "customerService:客服\n" +
    "overseaCustomerService:海外客服\n" +
    "operaterId:操作Id\n" +
    "operater:操作\n" +
    "fileName:文件\n" +
    "financialAffairs:财务\n" +
    "bookingSpace:订舱/仓管\n" +
    "cabinetNum:派车/柜号\n" +
    "billOfLading:订单号\n" +
    "customerId:客户id\n" +
    "customer:客户\n" +
    "bookingAgent:订舱代理\n" +
    "dispatchAgent:派送代理\n" +
    "customsClearanceAgent:清关代理\n" +
    "productCode:货物品名 / 商品编码\n" +
    "productNum:商品数量\n" +
    "tradeTerms:贸易条款 / 申报货值\n" +
    "reconciliationDate:对账日期\n" +
    "bookingSpaceEtd:订舱ETD\n" +
    "dispatchDate:派送日期\n" +
    "paymentPath:付款方式\n" +
    "termsOfService:服务条款\n" +
    "referenceNumberEdi:参考号(EDI)\n" +
    "ctnMawb:CTN/MAWB#\n" +
    "originatingArea:始发区域\n" +
    "arrivalArea:到达区域\n" +
    "placeOfReceipt:收货地\n" +
    "originSz:始发地 (SZ001)\n" +
    "transitPlace:中转地\n" +
    "destination:目的地\n" +
    "hbl:HBL号\n" +
    "consigneeId:收货人id\n" +
    "consignee:收货人\n" +
    "notifierId:通知人id\n" +
    "notifier:通知人\n" +
    "pickUpAgent:提货代理\n" +
    "shippingMark:唛 头\n" +
    "productDec:货物描述\n" +
    "shippingAddress:送货地址\n" +
    "remark:备注\n" +
    "orderNum:排序\n" +
    "",httpMethod = "POST")
  @PostMapping("/save")
  public JsonResult save(Model model, PutInfo putInfo) {
    return putInfoService.save(putInfo, getLoginUser());
  }

  /**
   * 修改入库单基本信息
   */
  @PreAuthorize("hasAuthority('orderB:putInfo:update')")
  @OperLog(value = "入库单基本信息", desc = "修改", param = false, result = true)
  @ApiOperation(value ="修改入库单基本信息",notes = "" +
    "id:id\n" +
    "insideRemark:内部备注\n" +
    "entrustmentRemark:托书备注\n" +
    "name:业务员id\n" +
    "stockNum:业务员\n" +
    "salesmanId:业务员Id\n" +
    "salesman:业务员\n" +
    "examineId:审核员Id\n" +
    "examine:审核员\n" +
    "customerServiceId:客服id\n" +
    "customerService:客服\n" +
    "overseaCustomerService:海外客服\n" +
    "operaterId:操作Id\n" +
    "operater:操作\n" +
    "fileName:文件\n" +
    "financialAffairs:财务\n" +
    "bookingSpace:订舱/仓管\n" +
    "cabinetNum:派车/柜号\n" +
    "billOfLading:订单号\n" +
    "customerId:客户id\n" +
    "customer:客户\n" +
    "bookingAgent:订舱代理\n" +
    "dispatchAgent:派送代理\n" +
    "customsClearanceAgent:清关代理\n" +
    "productCode:货物品名 / 商品编码\n" +
    "productNum:商品数量\n" +
    "tradeTerms:贸易条款 / 申报货值\n" +
    "reconciliationDate:对账日期\n" +
    "bookingSpaceEtd:订舱ETD\n" +
    "dispatchDate:派送日期\n" +
    "paymentPath:付款方式\n" +
    "termsOfService:服务条款\n" +
    "referenceNumberEdi:参考号(EDI)\n" +
    "ctnMawb:CTN/MAWB#\n" +
    "originatingArea:始发区域\n" +
    "arrivalArea:到达区域\n" +
    "placeOfReceipt:收货地\n" +
    "originSz:始发地 (SZ001)\n" +
    "transitPlace:中转地\n" +
    "destination:目的地\n" +
    "hbl:HBL号\n" +
    "consigneeId:收货人id\n" +
    "consignee:收货人\n" +
    "notifierId:通知人id\n" +
    "notifier:通知人\n" +
    "pickUpAgent:提货代理\n" +
    "shippingMark:唛 头\n" +
    "productDec:货物描述\n" +
    "shippingAddress:送货地址\n" +
    "remark:备注\n" +
    "orderNum:排序\n" +
    "",httpMethod = "POST")
  @PostMapping("/update")
  public JsonResult update(Model model, PutInfo putInfo) {
    return putInfoService.update(putInfo, getLoginUser());
  }

  /**
   * 删除入库单基本信息
   */
  @PreAuthorize("hasAuthority('orderB:putInfo:remove')")
  @OperLog(value = "入库单基本信息", desc = "删除", result = true)
  @ApiOperation(value ="删除入库单基本信息",notes = "" +
    "id:id\n" +
    "",httpMethod = "POST")
  @PostMapping("/remove")
  public JsonResult remove(PutInfo putInfo ) {
    return putInfoService.remove(putInfo, getLoginUser());
  }

}
